﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Program05
{
    public class Student
    {
        //学号
        public string No{ get; set; }
        //姓名
        public string Name { get; set; }
        public int age { get; set; } = 18;

        public int Age
        {
            get => age;
            set => age = value > 150 || value < 0 ? 0 : value;
        }

        public override string ToString() => $"学号:{No} 姓名:{Name} 年龄:{Age}";
        
    }
}
